package com.gxgeek.javabasic.ClassLoader;

/**
 * Created by gx on 2017/7/5.
 */
class SingleTon {
    private static SingleTon singleTon = new SingleTon();
    public static int count1;
    public static int count2 = 0;
    private SingleTon() {
        count1++;
        count2++;
    }

    public static SingleTon getInstance() {
        return singleTon;
    }
    public static Integer getInteger() {
        return 1;
    }

}

public class Test_1 {
    public static void main(String[] args) {
        System.out.println(SingleTon.getInteger());
        SingleTon singleTon = SingleTon.getInstance();
        System.out.println("count1=" + singleTon.count1);
        System.out.println("count2=" + singleTon.count2);
    }
}
//答案
//count1=1
//count2=0

